import Vue from 'vue'
import Vuex from 'vuex'

import {MUTATION_TAKE_ACCESS_TOKEN,MUTATION_TAKE_LIVE_ROOM} from './mutations'

Vue.use(Vuex);

const store = new Vuex.Store({
  state: {
    accessToken: null,
    liveRoom:null,
    uid: null,
  },
  mutations: {
    [MUTATION_TAKE_ACCESS_TOKEN](state, tokenInfo) {
      state.accessToken = tokenInfo.access_token;
      state.uid = tokenInfo.uid;
    },
    [MUTATION_TAKE_LIVE_ROOM](state, liveRoom) {
      state.liveRoom = liveRoom;
    },
  },
  getters: {},
  actions: {

  },
});

export default store;
